<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8">
		<title>{:C('defaultinfo.name')} - Powered By {:L('AUTHOR')}</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
		<meta name="description" content=""/>
		<meta name="author" content="{:L('AUTHOR')}"/>		
		<link type="text/css" href="__PUBLIC__/css/app.css" rel="stylesheet" />
		<link rel="shortcut icon" href="__PUBLIC__/ico/favicon.png"/>
		<script src="__PUBLIC__/js/jquery-1.9.0.min.js" type="text/javascript"></script>	
		<style>
			.inright{width:70%;}
			.itext{text-overflo:none;}
		</style>
	</head>
	<body>
		<div class="title">
			<img id="img" src="__PUBLIC__/appImg/title_bg.jpg" />
			<div class="title1">{$customer['name']}</div>
		</div>
		<div class="top">
			<div class="line"></div>
				<ul class="relevant">
					<li class="ta" rel="1">
						<dl>
							<dt><div class="item item1"></div></dt>
							<dd><span class="count_num1">基本信息</span></dd>
						</dl>
					</li>
					<li class="ta" rel="2">
						<dl>
							<dt><div class="item item2"></div></dt>
							<dd><span class="count_num">商机（{$customer['business_count']}）</span></dd>
						</dl>
					</li>
					<li class="ta" rel="3">
						<dl>
							<dt><div class="item item3"></div></dt>
							<dd><span class="count_num">联系人（{$customer['contacts_count']}）</span></dd>
						</dl>			
					</li>
					<li style="background:none" class="ta" rel="4">
						<dl>
							<dt><div class="item item4"></div></dt>
							<dd><span class="count_num">沟通日志（{$customer['log_count']}）</span></dd>
						</dl>				
					</li>
				</ul>
			<div class="shadow"></div>
		</div>
		<div class="zhong "></div>
		<div class="content">
			<div class="ta1">
				<div class="shang">
					<table class="table">
						<tbody>
							<tr><th colspan="2">基本信息</th></tr>
							<tr>
								<td colspan="2">
									<table width="100%">
										<tr>
											<td class="tdleft">创建时间：</td>
											<td class="tdright"><if condition="$customer['create_time'] neq 0">{$customer.create_time|date='Y-m-d H:i:s',###}</if></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<table width="100%">
										<tr>
											<td class="tdleft">创建人：</td>
											<td class="tdright"><a class="role_info" href="role_name:{$customer.create.role_id}">{$customer.create.user_name}</a></td>
										</tr>
									</table> 
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<table width="100%">
										<tr>
											<td class="tdleft">负责人：</td>
											<td class="tdright"><a class="role_info" href="role_name:{$customer.owner.role_id}">{$customer.owner.user_name}</a></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td colspan="2">
									<table width="100%">
										<tr>
											<td class="tdleft" >最后修改时间：</td>
											<td class="tdright"><if condition="$customer['update_time'] gt 0">{$customer.update_time|date='Y-m-d H:i:s',###}</if></td>
										</tr>
									</table>
								</td>
							</tr>
							<!-- <tr>
								<td colspan="2">
									<table width="70%">
										<tr>
											<td class="tdleft">网    址：</td>
											<td class="tdright"><a href="">www.5kcrm.com</a></td>
										</tr>
									</table>
								</td>
							</tr> -->
							<tr>
								<td class="tdleft"></td>
								<td></td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="zhong"></div>
				<div class="shang">
					<table class="table">
						<tbody>
							<tr><th colspan="2">其他信息</th></tr>			
							<tr>
								<volist name="field_list" id="vo">
									<tr>
										<td colspan="2">
											<table width="100%">
												<tr>
													<td class="tdleft">{$vo.name}：</td>
													<if condition = "$customer[$vo['field']] neq ''">
														<if condition="$vo['form_type'] eq 'datetime'">
														<td class="tdright"><if condition = "$customer[$vo['field']] neq 0">{$customer[$vo['field']]|date='Y-m-d',###}</if></td>
														<elseif condition = "$vo['form_type'] eq 'editor'"/>
														<td class="tdright">--暂不支持该类型--</td>
														<else />
														<td class="tdright">{$customer[$vo['field']]}</td>
														</if>
													<else />
														<td class="tdright"></td>
													</if>
												</tr>
											</table>
										</td>
									</tr>
								</volist>
							</tr>					
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div class="zong ta2">
			<volist name="customer['business']" id="bus">
				<a href="{:U('Business/view','id='.$bus['business_id'])}">
					<div class="hang">
						<div class="lleft">{$bus['name']}</div>
						<div class="lright">&gt;</div>
					</div>
				</a>
			</volist>
		</div>
		<div class="shangji ta3">
			<volist name="customer['contacts']" id="con">
				<div class="con_item">
					<div class="con_item_name">{$con['name']}</div>
					<div class="con_item_phone">{$con['telephone']|default='暂无联系方式'}<br/>[<if condition ="$con['post']">{$con['post']}-</if>{$customer['name']}]</div>
					<div class="con_item_call"><a href="/telephone:{$con['telephone']}"><if condition="$con.telephone neq ''"><img src="__PUBLIC__/appImg/phone.png" /></if></a></div>
				</div>
			</volist>
		</div>
		<div class="zong2 ta4">
			<volist name="customer['log']" id="log">	
				<div class="log_item">
					<div class="ipic">
						<img <if condition="$log[owner][img]">src="{$log[owner][img]}"<else/>src="__PUBLIC__/ico/logo.jpg"</if> style="width: 60px;height: 60px;box-shadow: 0 1px 3px;border-radius: 0px;"/>
					</div>
					<div class="inright">
						<div class="iname"><notempty name="log['owner']['user_name']"><a class="role_info" rel="{$log.owner.role_id}" href="javascript:void(0)">{$log[owner][user_name]}</a></notempty>&nbsp;</div>
						<div class="zhi">[{$log[owner][role_name]}-{$log[owner][department_name]}]</div>
						<div class="itime">{$log.create_date|date='Y-m-d H:i:s',###}</div>
						<if condition="strlen($log['content']) gt 100">
							<div class="itext" id="slog_{$log.log_id}">
								{$log.content|msubstr=###,0,30}<br/><a class="more" rel="{$log.log_id}" href="javascript:void(0)">全文</a>
							</div>
							<div class="itext" id="llog_{$log.log_id}" style="display:none;">
								{$log.content}
							</div>
						<else/>
							<div class="itext">{$log.content}</div>
						</if>	
					</div>
				</div>
				<div class="zhong"></div>
			</volist>
		</div>
	</body>
		<script type="text/javascript">
				$('.ta').click(
					function(){
						var num = $(this).attr('rel');
						for (var i=1;i<5;i++){
							if(num == i){
								$('.ta'+i).show();
								$('.ta[rel='+i+'] .item').addClass('item_bg_active');
								$('.ta[rel='+i+'] span').css('color','#369FE2');
							}else{
								$('.ta'+i).hide();
								$('.ta[rel='+i+'] .item').removeClass('item_bg_active');
								$('.ta[rel='+i+'] span').css('color','#878787');
							}
						}
					}
				);
				$(".more").click(function(){
					$(this).hide();
					var log_id = $(this).attr('rel');
					$('#llog_'+log_id).show();
					$('#slog_'+log_id).hide();
				});
		</script>
</html>